package com.fulihui.usercore.api;

import org.near.servicesupport.request.TPageRequest;
import org.near.servicesupport.request.TRequest;
import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TPageResult;
import org.near.servicesupport.result.TSingleResult;

import com.fulihui.usercore.condition.MerchantCondition;
import com.fulihui.usercore.dto.MerchantDTO;
import com.fulihui.usercore.request.merchant.MerchantSaveRequest;
import com.fulihui.usercore.request.merchant.UpdateStateRequest;

/**
 * 分表分库 无需修改
 * 商户服务
 * Created by Willard.Hu on 2016/5/17.
 */
public interface MerchantService {

    /**
     * 保存商户
     * @param request {@link MerchantSaveRequest}
     * @return 返回接口调用结果 {@link BaseResult}
     */
    TSingleResult<String> save(MerchantSaveRequest request);

    /**
     * 更新状态
     * @param request {@link UpdateStateRequest}
     * @return 返回接口调用结果 {@link BaseResult}
     */
    BaseResult updateState(UpdateStateRequest request);

    /**
     * 按主键查询商户
     * @param request 商户唯一标识
     * @return 返回商户单一查询结果 {@link MerchantDTO}
     */
    TSingleResult<MerchantDTO> queryByPK(TRequest<String> request);

    /**
     * 分页查询商户
     * @param request {@link MerchantCondition}
     * @return 返回商户分页查询结果 {@link MerchantCondition} {@link TPageRequest}
     */
    TPageResult<MerchantDTO> queryPage(TPageRequest<MerchantCondition> request);
}
